#include <iostream> 
using namespace std;

class Integer {
public:
	Integer (void) {
		cout << "无参构造函数" << endl;
		m_data = 0;
	}
	Integer (int data) {
		cout << "类型转换构造函数" << endl;
		m_data = data;
	}
	void print (void) {
		cout << m_data << endl;
	}
private:
	int m_data;
};

int main (void)
{
	Integer i;
	i.print (); //0
	
	//编译器会自动调用integer的类型的构造函数 
	//将100转换interger类型的对象, 再给i赋值
	i = Integer (200); //C++风格
	//i = (Integer)100;	//C风格
	i.print ();//100

	return 0;
}
